#/usr/bin/python
#coding:utf-8

import MySQLdb

con = MySQLdb.connect(user="larry",db="test")
cur = con.cursor()
cur.execute("SELECT * FROM users")
for user in cur.fetchall():
    print user

cur = con.cursor(MySQLdb.cursors.DictCursor)
cur.execute("SELECT * FROM users")
for user in cur.fetchall():
    print user
    print '郎' == user['login']
con.close()
